package daofactory;

import java.sql.Connection;
import java.sql.DriverManager;

import dao.ifaces.CategoriaDao;
import dao.ifaces.ProductoDao;
import dao.mysql.MySql_CategoriaDao;
import dao.mysql.MySql_ProductoDao;

public class MySqlDaoFactory extends DaoFactory {
	
	static final String usuario = "root";
	static final String clave 	= "root";
	static final String url 	= "jdbc:mysql://localhost:3306/tiendavirtual";
	
	public static Connection obtenerConexion(){
		Connection con = null;
		
		try {
			Class.forName("com.mysql.jdbc.Driver");
			con =  DriverManager.getConnection(url,usuario,clave );
			
		} catch (Exception e) {
			System.out.print(e.getMessage());
			
		}	

		return con;
	}
	
	public CategoriaDao getCategoriaDao(){
		return new MySql_CategoriaDao();
	}

	public ProductoDao getProductoDao(){
		return new MySql_ProductoDao();
	}
}
